Good question. Airbags are, in fact, designed to pop out and blow up from the front based on impact. They are less likely to deploy with a hit from the side or the rear.
Some cars like the newer VW bug have airbags along the sides now. This doesn’t solve the problem of rear impact. Head and neck injuries are still a problem with rear impact.
Until all vehicles have a more complete restraint system, it’s best to use your seatbelt at all times. Studies show seatbelts combined with airbags still offer the best protection.