This part of the 12th Amendment is a holdover from the prior rules:
The Electors shall meet in their respective States, and vote by Ballot
for two persons, of whom one at least shall not lie an Inhabitant of
the same State with themselves.
The Founding Fathers thought that if electors only had one vote, they'd each vote for a “favorite son” from their own state. The second vote would ensure that the President would have nationwide appeal.
In practice, we quickly ended up with national political parties instead of a patchwork of regional parties, so the requirement wasn't really necessary. But it was never changed. What did change was that Electoral College ballots now distinguish between President and VP votes.
What the Constitution says is that an elector of State X is not allowed to vote for both a presidential candidate who resides in State X and a VP candidate from State X.
But it's OK for a State X elector to vote for a State X resident for president and a State Y resident for VP. (In fact, most presidential candidates do win their home states.) Or vice versa: A State X elector can vote for a State Y presidential candidate and a State X VP. Just not both from State X. On the other hand, electors from State Y and State Z are perfectly free to vote for two State X candidates.
This is from the Constitution's viewpoint that assumes electors make their own decisions on whom to vote for. With political parties and pledged electors, it doesn't quite work that way.
So, what would happen if a party nominated a presidential candidate and a VP candidate from the same state? Without loss of generality, I'll assume that the state is Texas (and thus, that the party is the Republican party).
For the electors on the other side of the Sabine or Red Rivers, there would be no problem. None of them would be voting for a resident of their own states, so they'd meet the Constitution's requirement.
In Texas, however, electors would be prohibited from voting for both halves of their party's ticket. What they'd probably do is to vote for their party's presidential candidate, and become “faithless electors” when it came to the VP, either abstaining from that vote, or voting for a non-Texan (presumably, a different member of their own party) for that office.
Suppose that the election was close enough that Texas would swing it. The Republican presidential candidate would have an absolute majority of the electoral votes, and thus win the election, but no VP candidate would have a majority. The VP would then be elected by the Senate.
If the (newly-elected) Senate were controlled by Democrats, we'd end up with a President and Vice-President from different parties, and fights over the Secret Service budget.
To avoid this scenario (and for other “balancing the ticket” reasons), presidential candidates never nominate VP candidates from their own states.