Optimus Prime is a name made of two Latin superlatives. Optimus means "best," and prime goes back to primus, "first." The Autobot leader is, by name, the best and the first.

He did not start with it. The toy behind him was Battle Convoy, a truck from Takara's Japanese Diaclone line. In Japan the character is still called Convoy.

The name came from Marvel Comics. Bob Budiansky, who named much of the original cast, described the process in a 2004 interview with Ben's World of Transformers. Jim Shooter wrote a first Transformers treatment, which Budiansky guessed Hasbro had approved, and the characters then needed filling out. Shooter first gave the job to Dennis O'Neil. Hasbro rejected much of O'Neil's character work, but one name survived. "I'm pretty sure he came up with the name Optimus Prime," Budiansky said.

He placed the work around Thanksgiving 1983, with Hasbro's deadline close and much of the staff away for the holiday. Budiansky called himself about the fourth or fifth choice for the job. He then wrote names and profiles for the first two dozen or so Transformers, and Hasbro approved them with few changes. Wikipedia's article on Optimus Prime states the credit to O'Neil flatly, and Slashfilm also credits him.

The Latin is straightforward. Etymonline gives optimus as "best, very good," the superlative of bonus, "good," with an uncertain deeper origin. English took optimum from it in 1879. Prime comes through Old French from Latin primus, "first," and figuratively "chief, principal; excellent." English has used prime for "first in rank, degree, or importance" since the 1610s.

Budiansky's own names took a different approach. He built Megatron from megaton and electronics. Hasbro worried it sounded too scary, since it made people think of nuclear bombs. Budiansky replied that the villain was supposed to be scary, and the name stayed. He took Ratchet from One Flew Over the Cuckoo's Nest and Ironhide from the TV series Ironside.

So the hero got a Latin title of rank, and the villain got a bomb. The character first appeared in The Transformers in 1984.