Apache shouldn't change ports while it is running. When it starts, it attempts to bind to its configured ports (80 and 443 in this case). Often this can be a problem, especially in Linux/Mac environments where ports < 1024 are restricted (only root/admin processes can bind to these ports), which is why the default XAMPP Apache ports are often 8080 and 8443.
Note that whenever a browser connects to a given remote host:port (even if that host is 127.0.0.1 a.k.a. localhost), it has to create a local port for the TCP connection, which is (in general) randomly chosen from the user-space set (the range 1024-65535). If you simply "netstat -n" your connections you'll find something like local 127.0.0.1:45678 connecting to remote 127.0.0.1:80 (if 45678 was the randomly-assigned local port). Note that the local port changes on every connection (every page refresh, unless KeepAlive is on), and shouldn't matter. Note also that the destination of the connection is called "remote" even if it's the localhost/127.0.0.1 loopback address.