A bit confused on how mongo and mongod load configuration files
When you are using automation agent, configuration is done at OPS manager (or cloud front) and there is not much what you can do at actual machine. Yes, in this case, automation agents config file includes information of port and other parameters.

When you start locally installed mongod (f.ex. systemctl start mongod), it is set at (systemctl) mongod.service file that startup command is mongod -f /etc/mongod.conf, so config file is /etc/mongod.conf where all startup parameters has been defined.