So being descended from Ay qualified her to be queen, I guess. I didn’t know Ay had any children; the XVIII dynasty pretty much ended with him (there’s a bit of confusion over whether Horemheb belonged to dynasty XVIII or XIX).
Horemheb was an appointee, a vassal governor.
http://www.varchive.org/tac/hararch.htm
http://www.varchive.org/tac/index.htm
http://www.varchive.org/tac/endakhn.htm