When people act frantically or in an uncontrolled manner, it's best to give them their space. If there's a fire in a building, everyone will be stampeding frantically to the nearest exit. Just try not to get trampled.
The word frantically comes from the Middle English frentik meaning "insane, violently mad," which is just what someone behaving frantically acts like. This word can be used to describe any number of actions. Your mother might be frantically pacing the room if you come home well after your curfew, or you might be frantically running to a class if you're late.