Many days after bidding the penguins goodbye, Alex has a nightmare about himself and his friends still being stranded in Africa and finding that they have all gotten old. He then wakes up from his nightmare on his birthday and the animals present him with a miniature model of New York City made out of mud. Alex suggests to his friends and the lemurs that they should go to Monte Carlo to get the penguins and the chimpanzees and fly back to New York City, which they agree to do.

As a cub, Alex the Lion was called Alakay and was the son of Zuba, the alpha lion. Though Zuba tries to teach Alakay to be a hunter, the cub is more interested in dancing, and is captured by poachers when Makunga, Zuba's rival, challenges Zuba to a fight for the position of alpha lion. Alakay is forced into a crate, and taken away despite Zuba's attempts to rescue him. The crate falls into the ocean where it drifts to New York. There, Alakay is renamed Alex and sent to the Central Park Zoo where he grew up, meeting Marty the Zebra, Melman the Giraffe, and Gloria the Hippopotamus. Most of the events of the first film are then described through a series of news flashes.

At the Central Park Zoo, Marty the zebra is celebrating his tenth birthday, but longs to see the rest of the world from outside his pampered life at the zoo, believing that he can find wide-open spaces to run around in, like in Connecticut. Marty's best friend, Alex the lion, attempts to cheer up his friend by singing Frank Sinatra's "New York, New York" with him. Still unsatisfied, Marty gets some tips from the zoo's penguins: Skipper, Kowalski, Rico, and Private. The penguins are similarly trying to escape the zoo. Marty's friends — Alex the lion, Melman the giraffe, and Gloria the hippopotamus — realize Marty's folly and try to follow him. The four, along with the penguins and the chimpanzees Mason and his silent friend Phil, eventually find themselves at Grand Central Station, but are quickly sedated by tranquilizer darts when Alex's attempt to communicate with humans is mistaken for aggression. The zoo, under pressure from animal-rights activists, is forced to ship the animals, by sea, to a Kenyan wildlife preserve. During their travels, the penguins escape from their enclosure and take over the ship, intent on taking it to Antarctica. Their antics on the bridge cause the crates containing Alex, Marty, Melman, and Gloria to fall off the boat and wash ashore on Madagascar.

Every emperor penguin sings a unique song called a "heartsong" to attract a mate. If the male penguin's heartsong matches the female's song, the two penguins mate. Norma Jean, a female penguin, falls for Memphis, a male penguin and they become mates. They lay an egg, which is left in Memphis' care, while Norma Jean leaves with the other females to fish. While the males struggle through the harsh winter, Memphis briefly drops the egg. The resulting chick, Mumble, is unable to sing but can tap dance. Nevertheless, he is enamored with Gloria, a female penguin who is regarded as the most talented of her age. One day, Mumble encounters a group of hostile skua, with a leader who is tagged with a yellow band, which he says is from an alien abduction. Mumble narrowly escapes the hungry birds by falling into a crevice.

In Antarctica, three young penguins – Skipper, Kowalski, and Rico – defy the laws of nature to save an egg the other penguins believe to be doomed. After saving it from a pack of leopard seals and accidentally setting themselves adrift on an iceberg, the egg hatches into Private.

Thomas "Tom" Popper (Jim Carrey) is a divorced real-estate entrepreneur whose father traveled around the world during his childhood. He learns that his father has died during an adventure to Antarctica and discovers that his father's will asks for his son to be given a souvenir from his last adventure. The next week, a crate containing a gentoo penguin (Captain) shows up at his doorstep. Eventually, five more penguins arrive. Popper intends to give them away but changes his mind when his children, Janie and Billy (Madeline Carroll and Maxwell Perry Cotton), think that the animals are Billy's birthday present. That night, Popper meets with New York zookeeper Nat Jones (Clark Gregg), who asks for the penguins. Popper tries to stall him by asking him to collect the penguins another time. Jones agrees but not before warning that the conditions in Popper's apartment are not good enough to raise penguins. Popper is forced to pay the board of his apartment to keep the penguins in his apartment and lies to his arrogant neighbor Kent (David Krumholtz) about there being no animals in his home.

Erik, son of the penguins Mumble and Gloria, is unable to dance like Emperor-Land. Erik and his two best friends, Bodicea and Atticus, follow Ramon to Adélie-Land and find that Adélie-Land has been ruled by a God-like "penguin" named Sven. Sven is actually a puffin in Adélie-Land who survived the loss of his native fishing grounds due to his "miraculous" ability to fly. Erik instantly becomes enamored with Sven, who takes a liking to him. Sven and Lovelace tell the others that they were saved by humans. The two eventually flee (under Sven's mistaken assumption that the humans were going to eat them) and end up on Antarctica, where Sven performs his first miracle by revealing moss to the local penguins. Sven uses his power of "Sven Think" to help Ramon find a mate. Ramon instantly falls in love with Carmen, another Adélie penguin who is uninterested. Mumble follows the chicks' footprints to Adélie-Land and orders them to return to Emperor-Land, but they refuse. Sven sends Erik back to Emperor-Land with Mumble.

A documentary crew follows the events of Cody Maverick, a 17-year-old rockhopper penguin who lives in Shiverpool, Antartica with his mother Edna and his older brother Glen. Cody has wanted to be a professional surfer ever since a visit from legendary surfer Ezekiel "Big Z" Topanga several years ago. When a talent scout shorebird named Mikey (Mario Cantone) arrives to find entrants for the "Big Z Memorial" surfing contest, Cody jumps at the chance despite the lackluster support from his family. En route to the contest, Cody befriends another entrant, Chicken Joe.

In Edwardian London, 1910, Cockney one-man band Bert is entertaining a crowd when he senses a change in the wind. Afterwards, he directly addresses the audience and gives them a tour of Cherry Tree Lane, stopping outside the home of the Banks'. George Banks returns home from his job at the bank to learn from his wife Winifred that their hired nanny, Katie Nanna, has left their service after his children, Jane and Michael, ran away again. They are returned shortly after by the local constable, who reveals that the children were dragged away by their kite. The children ask their father to help build a better kite, but he dismisses them. Taking it upon himself to hire a nanny, George advertises for a stern, no-nonsense nanny. Jane and Michael present their own advertisement for a kinder, sweeter nanny, but George rips up the letter and throws the scraps in the fireplace, which magically float up and out into the air.

Hubie, a shy, gullible but kindhearted penguin, is in love with the beautiful and kind Marina, but lacks self-confidence leading him to be bullied by the much more impressive, but vain and cruel Drake, who also wants Marina, but clearly for lust. One night, Hubie and Marina manage to confirm how they feel for each other, but Hubie cannot quite find a perfect pebble to propose to Marina with. He wishes on a star to make his dream come true and he receives an emerald from the sky. Ecstatic, Hubie rushes to find Marina but is stopped by Drake, who demands Hubie to give him the pebble. Hubie refuses, so Drake throws him into the water. Hubie narrowly escapes from a leopard seal and climbs on to a piece of ice where he is swept away from Antarctica.

Samuel L. Jackson narrates the story about a group of male penguins that make a 70-mile trek to go to their breeding grounds where females are waiting to have sex with them. These penguins include Carl (Bob Saget) and Jimmy (Lewis Black), two friends who talk about relationships and other things as they meet new characters including Marcus (Tracy Morgan), a penguin who likes to kid around and brag about his huge penis (an illogical point, since penguins do not have penises and instead have cloacas), and Steve the snowy owl (Jonathan Katz), who gives Carl advice on his life in a Freudian kind of way while billing him for the two quick sessions. Meanwhile, Melissa (Christina Applegate) and Vicky (Mo'Nique) argue about men and other women who bother them as they wait for their mates to arrive at the breeding grounds.