The concept, which originated and became popular in Chinese Buddhism, features a pair of highly stylized lions - often one male with a ball and one female with a cub - which were thought to protect the building from harmful spiritual influences and harmful people that might be a threat.
In Chinese art pairs of Buddhist lions are guarding temple gates against demons. These temple lions always comes in pairs. As always when mythology is mixed up with traditions the stories are quite complex, sometimes contradictory or overlapping.
Despite that the phrasing can vary, the basics is that the eastern lion rolls a ball (magic sphere) containing the lion cub, helping it to hatch out; the western lion suckles its cub.
See also: Fu (Foo) Dogs