Even though he is a lion and is a carnivore, James always acts very friendly towards humans and his personality is quite similar to them, for instance, he only eats cooked food, sometimes loves playing pranks on others, has manners and (one of the main things) he talks. Although, when it goes towards family threats, James does act like a wild animal to protect his friends or family.
Little is known about James' past, except that he was raised as a little cub in the Circus, but after his debut act as 'The Bravest Lion Cub in the World' when he was four lion-years old, which turned into a big flop because of his squeaky roar and cowardness, his father called him an embaressment and the Ringmaster sold him to Doofenshmirtz Evil Inc.
Since Doofenshmirtz was bored of not having a worthy nemesis (Sammy the Grass Snake and George the Grasshopper were two of them) and watching all the James Blond films (similar to James Bond), he zapped the young lion cub with his Act-More-Humanistic-Inator, which caused him to talk, but since the lion cub wasn't old enough to be a nemesis yet, Doofenshmirtz put him in a cage until he would be an adult.
But thankfully, the lion cub squeezed through the bars (because he was put in a big cage which had big spaces between the bars) and escaped into the dark rainy streets of Danville, and after nearly being run over by cars, caught in a streamlined flood which lead to the sewers but escaped and chased by vicious dogs, he ran into an alleyway and slept all the way through the night next to a dumpster.
In the morning, the lion cub was found by Candace just after she and the rest of the Flynn-Fletcher family had adopted Perry from the Pet Shop. Candace's parents allowed her to keep him because, them saying, it would make them even more unique to have a talking lion cub as pet, and after that, Candace named him James.