Shakespeare never published. He lived before copyright laws. There were people who were paid to attend plays at the Globe theatre and memorize the scripts. Soon the Globe’s competitors would produce the same plays.
The folios were published six years after his death, represent some sort of consensus of Shakespeare work. There was more than one publisher of Shakespeare’s folios, and they do not all completely agree. What we think of as Shakespeare is the consensus opinion of Shakespeare scholars, mostly from the 19th Century.
FWIW, Homer’s works were never written down until 200 years after his death, though his poems were recited from memory by bards continuously until they were codified in written consensus versions.