Certbot uses ones ability to present a resource (aka acme-challenge) on the domain for issuing certs (either via http or dns txt record).
More info: https://certbot.eff.org/docs/using.html#changing-a-certifica...