A/D nominal port interaction

Because when you call the analogRead function the code makes sure that it is routed as an analogue input, this overrides anything you have previously set on that pin, with the exception of the INPUT_PULLUP call.

It is setting the registers that define the switches on the input pin connecting it to other circuitry in the processor.

It can enable or disable the input pull up resistor. In fact that was the way you enabled the pull up resistor, by defining a pin as an input and the writing high to it. It got changed about 12 years ago to make it less confusing to people.