A "cue" in this context is a signal that an action is required--such as an actor on a stage beginning a line after a certain phrase is said. "As if on cue" essentially means that it was occurring regularly, as though a signal were being provided, when in fact no such signal existed. This phrase also comes in handy when something occurs while or immediately after being talked about.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.