Frogs primarily croak to advertise their fitness to perspective mates. The males are responsible for the vast majority of the croaks heard in a typical chorus, but the females of some species can also create vocalizations. When a female hears a frog with an attractive call, she approaches him and allows him to mount her and achieve amplexus.
Every species of frog has a distinctive call. This allows males and females of the same species to find each other, breed and produce viable offspring. In fact, some frog species are visually identical, and they were thought to be a single species until their calls were analyzed, indicating that two species were masquerading as one.
Sometimes, an over-anxious male grabs another male and attempts to breed with him. When this happens, the male mistaken for a female then produces something called a release call. Release calls instruct the mounting frog that he has mistakenly grabbed an inappropriate mate.
Some frogs also make vocalizations when they are grabbed by a predator. This is called a predator call, and both sexes are capable of producing these sounds. Such sounds are thought to startle the predator, or in the case of snakes and other animals that cannot hear, attract secondary predators. These secondary predators may attack the primary predator, allowing the frog to escape.