Ryan Lochte at his peak (2011 Worlds) was basically on par with peak Phelps. But at the Olympics, Phelps has out-performed Lochte each time. Lochte is one of the greats, but Phelps is just so far ahead of him as far as his reputation, and with good reason.
As far as swimming goes, though, Matt Grevers probably would have won gold in the 100 backstroke in Rio. He won gold in 2012, has a few world championships and got silver in 2008 behind Piersol. But he finished third behind Ryan Murphy and David Plummer at US Trials. Could be mistaken, but I believe that they had the top three times in the world this year for that event. You can only send two, though.
Another good swimming story is Laslo Cseh. He had a solid Olympics for his age, tied Phelps for the silver in the 100 fly, etc. But if it wasn't for Phelps or Lochte, Cseh would have quite a few gold medals and World Championships to his name. But he had to compete with Phelps in the 100/200 fly, and Phelps AND Lochte in both of the IM's.
Another one for America? Tyler Clary. Would've been a gold medalist in Bejing and China in the 400 IM and maybe the 200 too, but was behind Phelps and Lochte. Pretty sure he was also a great 200 fly / 200 back guy, so he could've won more golds in those, too. He got his gold, though, beating Lochte in the 200 back in London.
But yeah, Lochte would've been the face of the USA team in 2008 and 2012 if it wasn't for Phelps, that's for sure.
With that said, Phelps is the greatest by an incredible margin. In Beijing, he won five individual events – 400 IM (WR), 200 fly (WR), 200 free (WR), 100 fly, 200 IM (WR, I think?). His 100 split on the 4x100 free relay was an American record and would have placed third in the finals of the 100 free. His 100 and 200 backstrokes were also world-class.
Aside from the breaststroke races and maybe the 50 free, there wasn't a single event that, if Phelps focused on it, he wouldn't have won at an international level. And he was capable of threatening or shattering the world records in every single event. Breaststroke was his weakest stroke, but he still outsplit everyone in his breaststroke IM legs in those Olympics.
Even the 100 fly this year, which he won silver in. Last individual race on his schedule. Schooling put up a 50.39. Phelps was a 50.46 last year, early in his training, in a meet where he only focused on that and one other event. If that event was his primary focus (Schooling only had one other event earlier in Rio and didn't make it out of semis), Phelps would have probably been a 50.2 or 50.1.
It's *really* tough to properly contextualize how great Phelps was – and still is – at swimming. Dude is literally a Terminator.