Confused about input vs output pins

Im sorry I was referring to the PWM that is controlling the level of the LEDs. If the pins are acting as a path to ground, how is the PWM controlling the level of the LEDs?

And also, why are we using pins to send the current to ground? Why not just send connect the the LED to the ground after feeding in voltage through the 3 seperate LEDs? Is it because this is a common anode RGB LED? If it were a common cathod RGB LED, could I do it the way I described?

Thank you again, I appreciate it. I apologize, I'm a bit confused at the moment.