The popular vote determines who the electors vote for. States can vary in how they determine that but at this time 48 states have a winner take all system based on who wins the popular vote in the state.
The electors can not just arbitrarily change the outcome based on political pressure at the last minute.
It’s a relic of slavery and non democratic beliefs and we need to get rid of it.