The MQTT Specification talks about storing state for example in terms of durable subscriptions, retained [publications and partially completed message transfers for Qos 1 and Qos 2.
In practice server implementations interpret storing state in a number of ways ranging from a forced write to a disk to keeping the data in volatile memory which
is cleared if the server is restarted. This is also the case for the client implementation, though most of these seem to actually force the data to disk.
The consequence of not storing data by forcing it to disk in the server are:
Loss of retained publications, loss of durable subscriptions, loss of Qos =1 publications, loss or duplication of Qos=2 publications
In the client this would also result in loss or duplication of messages.
The client and server are only able to detect indirectly that the other has lost data, for example by failing to receive a retained publication.