The PIC data sheet shows the data flow at the pins in a diagram. Basically the output has two switches, one from the pin to VDD and one from the pin to GND. To drive the pin high, the VDD side switch is closed and the GND side one is open, to drive it low, the opposite is true, the VDD switch is open and the GND one closed. Internal circuits ensure it is impossible to close both switches at the same time as they would short out VDD and GND. When used as an input, both those switches are turned off so the pin isn't driven at all, this allows outside circuits to drive the pin and it's logic sense is read into the PORTx register.
Please understand that on an input pin, a pull up or pull down resistor is there for only one purpose, to ensure the logic level on the pin is at a known state. Input pins draw almost zero current so high value resistors can be used which makes it easy to drive them from outside circuits without the resistor causing much loading. If an input doesn't have a pull-up or pull-down and isn't driven from outside, it will 'float' at an indeterminate level, influenced by static charges and interference nearby and that would make operation unpredictable.
Brian.