Prequels were made only to sell more toys.
No, they were genuine attempts at filmmaking by Lucas. If all he wanted to do was market and sell toys he could have done that long before he made the prequels.
The problem is that when Lucas made the prequels, he was in a position where he had complete and absolute creative authority and nobody to challenge him at any level. He is also notoriously bad with actors and has admitted he doesn't much like working with them, which is very problematic for obvious reasons.
When you really consider and deconstruct the prequels, there's plenty of quality therein but where things fall apart are dialogue and the stilted acting. Had Lucas simply hired somebody to revise his scripts (like Kasdan) they could have done away with the cringey dialogue and the clunkier aspects of the storytelling, modified Jar Jar into something less shrill and one note and placed a bit more gravitas into Anakin and Padme's burgeoning relationship.
Lucas should have also hired a second director to handle all the filming in regards to the actors, given that Lucas seems to have little appreciation for the craft of acting and doesn't allow his actors to modify dialogue or improvise. Liam Neeson once spoke of how he had to fight Lucas just to place his hand on Shimi's shoulder when she discovers her son is leaving Tatooine.
It's actually astounding how easily the prequels could have been fixed had Lucas simply been willing to defer to somebody other than himself.