In TOS, the Enterprise encounters Trelaine, the self-titled Squire of Gothos. A seemingly omnipotent being that toys with the crew for his own amusement.
In TNG, the enterprise encounters Q, a seemingly omnipotent being that toys with the crew for his own amusement.
Trelaine was a child of his species and Q was an adult, but they had a similar “humans are toys” attitude. Q’s came with an added cynicism that you might expect from an adult of Trelaine’s species.
It has been pointed out that Trelaine seemed to rely on technology, which allowed Kirk to defeat him. But Q also always gave his playthings a chance one way or another and, again, Trelaine was a child.
So was Trelaine a Q? Was he from a different god-like species?
And here’s a real curveball for you- Was Trelaine a child Organian?
Now I’m not saying I recommend it, but Q-Squared by Peter David discusses exactly this.
I didn’t mind it. It wasn’t the best Star Trek book I ever read, but he didn’t do a terrible job tying things together.