During astral travel, you don’t lose your free will. You don’t “lose control” of your own body or mind. You are not asleep but rather somewhere between being fully awake and fully asleep.
Similarly to being hypnotized (or a self-hypnosis session), you are the one in control. Don’t be misguided by the exaggerated media portrayals of hypnotists making people do things against their will, that’s never the case in real life.
If someone were to shake you, you would come back right away. The other alternative is that you fall asleep and come awake when ready.
Astral travel, in and of itself, isn’t dangerous. As to why you would do it, it can be a therapeutic tool, but like any tools, if used inappropriately it could cause harm. For example, if you have a serious health condition such as being prone to having a heart attack or seizure when remembering a very bad moment in life.
If you are worried about things such as bad spirits or death, I recommend that you try to dispel those ideas before you go into astral projection because those thoughts could affect the outcome of your experience.
Instead, start the experience with positive and wholesome thoughts about yourself and your imminent experience. Visualize a protective circle and a white light around you.
Regarding spontaneous astral travel, I recommend you check out this topic in the Forum: My 1st Astral Travel Podcast