how the current flows in the dugutal pins?

Digital pins are switched to GND or Vcc using MOSFETs inside the device. The ATmega processors output
MOSFETs have about 30 to 40 ohms on-resistance, and are limited to an absolute maximum of 40mA

So they can power an LED or two, but not anything needing real power.