Maine and Nebraska have laws which allow those states to split their electoral votes.
Indeed, and in a few elections some “faithless electors” cast ballots for someone else...you see that too