I believe that Q is an Above Top Secret Clandestine circle of individuals that was created in the aftermath of JFK's assassination.. A pre-authorized deadman's switch that created the group.
They have been in the shadows since, operating in secret, watching, taking names, learning bahaviors and methods of the bad actors. Once they knew the full extent of their plans, they created their own counter Op, gained access to dark money (some of that Pentagon-unaccounted-for funds) and access to tip of the spear technology to assist in planning and execution, and recruited only the best, most diverse of opinion, most Patriotic individuals, and we've been watching that counter Op unfold.