The short answer is it just works.
This is a function of the router/switch depending how large you network is. If you are like many using a single router to do this the LAN ports on the back are on the same network as the wireless ports. Because by default these are on the same broadcast domain pretty much the pc just yell to everyone saying where are you and the printer responds. In larger corporate networks it gets a little more complex but in the worst case you would have to know the IP address to connect but microsoft has many automated features so in most case you just pick the printer off a list