Jesus’ words “Father, forgive them for they know not what they do.” are found in Luke 23:34. Jesus looked down from the cross and saw a very distressing view. The Roman soldiers were casting lots for His clothing (John 19:23–24); the criminals on the crosses to either side of Him were reviling Him (Matthew 27:44); the religious leaders were mocking Him (Matthew 27:41–43); and the crowd was blaspheming Him (Matthew 27:39). Jesus looked down upon these people and said, “Father, forgive them for they know not what they do.”
This is one of those most taken out of context passages. People often refer to it to emphasize forgiving others, which is a good thing to emphasize, but those who appeal to this verse to emphasize forgiveness often proclaim that those who do you wrong aren’t really fully aware of the wrong they’re doing to you. The problem is that most people know exactly what they are doing when they are doing it, so it makes no sense to say in every context "forgive them, for they know not what they do." Does a thief not know that he’s stealing? Does an adulterer not know that he’s cheating on his wife? Does a murderer not know that he’s killing an innocent human being? Of course they do! It makes no sense to say that they don’t. Granted, there are times when people don’t know fully what they’re doing (e.g a woman getting an abortion when she’s been deceived into thinking the fetus is just a blob of cells) but most people know exactly what they are doing. The people who don’t know are the exception, not the rule.
Jesus said “forgive them for they do not know what they are doing” but what did He mean by that? In context, the Romans were crucifying Jesus and this was plea from Jesus to the Father. Jesus desired that this sin not be held against them and it is why He made the plea. He said “they do not know what they are doing” because they were putting to death the Son of God, God incarnate, the Creator of the universe in human flesh (see John 1). They thought they were just putting to death another rebel or false messiah (there were a bunch of those running around back then), but they had no idea that they were killing the very One who made them. This conclusion is corroborated by 1 Corinthians 2:7-8 which says “No, we declare God's wisdom, a mystery that has been hidden and that God destined for our glory before time began. None of the rulers of this age understood it, for if they had, they would not have crucified the Lord of glory.” In other words, if they had known exactly who it was they were killing, they wouldn’t have done it. So this is likely what Jesus meant by “they know not what they do”. Not that they don’t know that they’re crucifying a man, but that they don’t know who it is they’re crucifying.
By the way, on a side note, for non-Molinists who think that God can’t have or does not have counterfactual knowledge, what do you think about 1 Corinthians 2:7-8? This seems to be a counterfactual. How could The Holy Spirit inspire Paul to write that statement down if The Holy Spirit doesn’t have knowledge of counterfactuals of creaturely freedom? This is only one out of several places in scripture where God seems to affirm that He knows what creatures would have done if they had been placed in different circumstances.