Peter didn’t like Jesus’ idea that He should come to Jerusalem to die. The Lord quickly identified who is really speaking there and said :”Get behind me, Satan”. Why did Satan want to stop the Lord from dying there, if he tried to kill Jesus from time when he was a baby?
I don’t think Jesus was accusing Peter of being Satan in Matt. 16:22-24. I think He was rebuking Peter for looking at events from an earthly perspective rather than a heavenly one. By pledging to protect Jesus from the officials, Peter was not following God’s will and that’s why he was accused of acting in Satan’s interest. The Lord’s comment about believers denying themselves by taking up their cross to follow Him supports this idea. Determining the direction of our own lives based on our Earthly perspective can actually benefit Satan because in the process we may be rejecting the Lord’s will for us.