How does esphome work

I am very new to home assistant and was able to add a dht sensor for temp humidity to HA using ESPhome. I however don’t understand how the entire process is working. There is nothing in the config file that points to any ESP Yaml code. I don’t have MTQQ installed yet the sensor is somehow communicating with the HA. I am really confused how this is working. Am not a programmer but am trying to understand what’s really going on here.
Additionally, I did install MQTT to try to understand how that works but for some reason i cannot change its password in MQTT setting → re-configure MQTT. Is this by design or am I doing something wrong.
Thank you for your help.

Via the ESPHome API. You don’t need MQTT for that. See

thank you.
Am reading this now and trying to understand.