In days gone by when one was about to sleep they would prepare and this was a sign that they were about to sleep. The process of spreading a mat was indicative of preparedness to sleep. However with death and its unpredictable timing one cannot prepare such a mat for themselves so that they are laid to rest comfortably or on a mat of their choice. Hence our saw the futility of one preparing for their time of death because this was unknown even though they could prepare generally for their dependents for a time when they would no longer be there.
The proverb is used to explain that is useless to prepare for your own death because you cannot tell when it will happen. This is not mean one should not prepare for death but it refers to the fact that one wouldn't know the timing and hence will always seem unprepared.