Ambien is dangerous stuff. Most people think it is a “sleep aid”, because that is how it is marketed. It is not a sedative, though, it is a “hypnotic”. Rather than actually inducing sleep directly, it shuts off your higher, conscious brain function while allowing your lower, subconscious functions to keep working, at least for some time.
Basically it can put you in a state similar to a sleepwalker, or a blacked out drunk, rather than just putting you to sleep.
It can be dangerous, true. I take it about once a month, cutting the dose in half. It puts me into a natural sleep with no side effects, providing the off switch perfectly. But for some folks it is a troublemaker.