Waking up during nights and not realizing is not a problem but waking up from a deep sleep and then struggling to sleep is a signal of health problems.
If your body is getting reduce amount of calcium or magnesium, or you are eating too much fatty and sugary things can also be the reason.
On the other hand your bad and old mattress can also be the reason of disturbing your sleep. It is recommended to change your mattress every 6 years on average so that your back can relax.
If your brain is not getting proper rest, it is being affected by tension or depression than it will impact your sleeping habit. For being healthy you need a healthy brain, which needs proper rest.
If you are going through some medications than it may be the reason of your sleeping disorder. As there are many medicines which affect your brain.