While I never really “hated” him, I didn’t really like him either. He’s based on the Peter Pan character of the same name.
In Once Upon a Time he finds Rumpelstiltskin before he meets his infamous captain. He apparently wants eternal life and is willing to go to great measures to get it.
But he later takes the “friendship” of Killian Jones when the captain promises to take him to Neverland, which grants eternal life… to all those who dwell in it as long as they stay
He proves to be quite loyal to Killian, but as Killian joins the good side, William Smee’s importance fades with that.