Sean (written "Seán" or "Séan" in Irish) is a Hibernization of the English name "John"; that is, it's a transliteration of "John" into a form which can be pronounced in Irish and written with the Irish alphabet (which nowadays is simply a version of the Roman alphabet).
The Irish language does not have the sound /ʤ/ (the sound which English typically writes as "J"). It does however have a /ʃ/ sound (a "sh" sound in English orthography), which happens when an "S" is followed by a front vowel (in Irish, by an "i" or an "e"). Thus, in Irish, the letter sequence "se" or "sé" is pronounced something like /ʃɛ/ or /ʃe/ respectively.
With the "a" following, the name "Seán" is pronounced (if I'm remembering my IPA symbols and pronunciations correctly) /ʃɒn/, which is about as close to English "John" /ʤɑn/ as they can get.
Thus, when the name Seán/Séan began to be used as an English name, it was used with the standard Irish pronunciation, which sounded like "Shawn" in English, and later began to be spelled that way as well.
(Note: Someone can please feel free to correct my IPA symbols; it's been 30 years and I don't remember the pronunciations as well as I used to.)