What is the meaning of "to swing the election"?

I know that a swing voter is someone who has not yet decided who to vote for in an election. But I'm not sure what the meaning of "to swing the election" is in the following two contexts. Does "swing" mean "to make a certain candidate win" the election?

Pennsylvania: With 20 electoral votes, this state appears most likely to swing the election next week.

Mr Ryan allowed that there was likely "organised shenanigans" in elections, but said that any incidents were in no way broad enough to swing the election in Mr Biden's favour.


Solution 1:

Lexico has in its 4th meaning:

swing
VERB

4.1 Have a decisive influence on (something, especially a vote or election)
an attempt to swing the vote in their favour

In the first example: with 20 electoral [college] votes, the result from Pennsylvania will probably decide the outcome of the [presidential] election.

In the second example: it is unlikely that any attempt to 'fix' the voting will influence the final result.

Solution 2:

In this context, to "swing an election" means to decide its outcome one way or the other.