Answer: The degree of guilt in any particular instance of sin is measured in part by the degree of one’s knowledge of right and wrong. James writes, “Whoever knows the right thing to do and fails to do it, for him it is sin” (Jas. 4:17). Jesus told the Pharisees, “If you were blind [lacking knowledge], you would have no guilt [relatively, not absolutely]; but now that you say, ‘We see,’ your guilt remains” (Jn. 9:41). And in another place he said,
“Woe to you, Chorazin! Woe to you, Bethsaida! For if the mighty works done in you had been done in Tyre and Sidon, they would have repented long ago in sackcloth and ashes. But I tell you, it will be more bearable on the day of judgment for Tyre and Sidon than for you. And you, Capernaum, will you be exalted to heaven? You will be brought down to Hades. For if the mighty works done in you had been done in Sodom, it would have remained until this day. But I tell you that it will be more tolerable on the day of judgment for the land of Sodom than for you (Matt. 11:21-24).From this we see that there are degrees of punishment in proportion to the degree of guilt, which in turn is determined in part (at least) by the degree of knowledge. The Jewish cities of Chorazin, Bethsaida, and Capernaum, the chief cities in which Jesus taught and performed his miracles, would receive a more severe judgment than the Gentile cities of Tyre, Sidon, and Sodom, because they sinned against greater knowledge. They had Jesus himself ministering in their midst! Their refusal to repent was inexcusable.
In another place, Jesus said, “That servant who knew his master’s will but did not get ready or act according to his will, will receive a severe beating. But the one who did not know, and did what deserved a beating, will receive a light beating” (Lk. 12:47-48a). The severity of the punishment is determined by the degree of knowledge each servant possessed. The servant who did not know his master’s will, received a less severe punishment. His ignorance, though not entirely excusable (he ought to have known his master’s will), somewhat mitigated his guilt.
Paul wrote of his own case, “I thank him who has given me strength, Christ Jesus our Lord, because he judged me faithful, appointing me to his service, though formerly I was a blasphemer, persecutor, and insolent opponent. But I received mercy because I had acted ignorantly in unbelief” (1 Tim. 1:12-13).
Let’s apply these principles to the situation you mention.
There were a number of different classes of people gathered around the scene of crucifixion: the Jewish rulers (Lk. 23:35), the Roman soldiers who actually nailed Jesus to the cross (Lk. 23:36-37), a large crowd of common people from the city (Lk. 23:27), and a small band of faithful women (Lk. 23:27-31). The women, of course, were not to be blamed for the crucifixion, and so the prayer was not offered for them. The remaining classes of people were to blame—some more so and some less. The Jewish leaders were most to blame. They were the primary figures behind the crucifixion of Christ, and consequently had the greatest guilt (Jn. 18:35; 19:11). They ought to have known that Jesus was the Messiah. “Are you the teacher of Israel, and do not understand these things?” (Jn. 3:10). They ought to have been first to have paid him the homage he was due as the Son of God. No one was in a better position to have known who he was than those who were the teachers of the Law. But they were blinded through envy (Mk. 15:10). Their actions were entirely inexcusable, and that’s why Jesus had earlier denounced utter ruin upon the city, which came forty years later by the hands of the Romans (Matt. 23:29-38).
The Roman soldiers were “just doing their job.” They were probably in no position to obtain a knowledge of the actual facts of Jesus’ case. All they knew was that he had been condemned by Pilate, who ordered his execution. For them it was simply a case of following orders. They would fit the description, “They know not what they do.” To a lesser extent, so would the crowds of common people, because, for the most part, they were deluded by the chief priests to ask for Jesus’ crucifixion (Matt. 27:20).
It would seem that Jesus’ prayer that they be forgiven was not a request for a full pardon of all sins, but a request for forgiveness for the particular sin of participation in his crucifixion. The crucifixion of Jesus was the darkest, foulest deed ever done by man, and deserving of an immediate and severe punishment. But Jesus prayed that this particular sin not be held against them, but that they be spared so as to have the opportunity to receive a full salvation which could only come through faith in him and his atoning sacrifice.
Was his prayer answered? Yes it was! How so? On the day of Pentecost and afterward many thousands of them who had had a part in Jesus’ crucifixion were brought by grace to repent and believe so as to be saved (Acts 2:32, 37-41).
John Calvin sums it all up well when he says,
It is probable, however, that Christ did not pray for all indiscriminately, but only for the wretched multitude, who were carried away by inconsiderate zeal, and not by premeditated wickedness. For since the scribes and priests were persons in regard to whom no ground was left for hope, it would have been in vain for him to pray for them. Nor can it be doubted that this prayer was heard by the heavenly Father, and that this was the cause why many of the people afterwards drank by faith the blood which they had shed.”