How are modes generated in a waveguide?
Key point: when we talk about the modes of a waveguide, we are often using that as shorthand for the propagating modes of the waveguide. However, the waveguide also has other modes, called evanescent modes. The evanescent modes don't carry energy along the waveguide, they just die out exponentially along the z-direction. Which is why those aren't normally the modes we mean when we talk about the modes of the waveguides. However, the evanescent modes are important to answering your question.

Let's say we place a feed antenna into a rectangular waveguide:



If we drive the antenna from outside, it will produce certain E and H field patterns.

We can express these fields as a superposition of the modes of the waveguide, so long as we consider both the propagating and the evanescent modes. This tells us how much of the input energy couples to the propagating modes and how much to the evanescent modes. Whatever part of the signal energy that corresponds to the propagating modes will propagate along the waveguide. The energy coupled into the evanescent mode effectively bounces back and forth. Some of it gets absorbed by conductive losses in the walls of the waveguide. But a larger part of it probably gets re-coupled to the feed antenna and appears as a reflection back up the feed line to the signal source.