No they don't always "know" how to get themselves back down into a sleep position again.
It is developmental that at certain ages, they will sit-up, pull-up, stand up in the crib. These will be upcoming developments.
Then when their coordination is in place, they will then know how to get themselves back into a sleep position, lying down, by themselves... from a sitting position or a standing-up position.
This is all normal.
At each change in motor skills ie: rolling over, sitting up, pulling up, standing... a baby "practices" these skills even when they are "supposed" to be sleeping. It is an impulse and they do not yet have impulse control at this age. Nor the muscle coordination.
So it will seem repetitious... for the parent.. but its normal. Whenever my kids attained a "new" motor skill.... they did this. Then once they were pulling-up and standing, they do this in the crib too. Its normal. It means their motor skills are developing normally.
A parent, at these junctures, has to help them or aide them to lie down again. Since they cannot do it on their own, perfectly and are still learning.
All the best,
Susan