In Mark’s Gospel there are three characters that go unnamed but are later named in John’s Gospel. They are:
(1) the woman who anoints (Mk 14:3) who John reveals as Mary (Jn 12:3);
(2) the man who wields the sword (Mk 14:47) who John reveals as Simon Peter (Jn 18:10);
(3) the servant of the high priest (Mk 14:47) who John reveals as Malchus (Jn 18:10).
These are examples of what Richard Bauckham (Jesus and the Eyewitnesses) calls ‘protective anonymity’ in the earlier accounts: this was not needed in a later account, when fear of embarrassment or reprisals would have partly or wholly disappeared.
This might also explain why Lazarus, whom Jesus restored to life, is mentioned only in John’s Gospel.