Warning: Spoilers for Obi-Wan Kenobi episodes 1 and 2.
Set ten years after Star Wars: A New Hope occurred, Obi-Wan was not surprised to meet Darth Vader on the Death Star and recognized him as his former apprentice. This means that at some point during Obi-Wan’s exile, he learned of Anakin’s survival.
Obi-Wan Kenobi finally showed this moment of discovery. At the end of Obi-Wan Kenobi episode 2, Reva, an Inquisitor determined to catch Obi-Wan, cornered him in a cargo port. While searching for him, Reva tried to intimidate Obi-Wan by revealing that Anakin was still alive as Darth Vader. Moreover, Anakin was looking for Obi-Wan. Although Obi-Wan managed to escape with a young Princess Leia, he was left in shock by the news.
Given that Obi-Wan was already struggling with memories from the last days of the Republic, learning of Anakin’s true fate would have only made matters worse. However, this also raises the question of how Obi-Wan did not know that Anakin was alive. Ten years into Emperor Palpatine’s reign, it seems like Obi-Wan should have heard that Darth Vader was still working for the Emperor. The answer could be that Obi-Wan’s exile, both physical and spiritual, on Tatooine prevented news from reaching him.
On a practical level, Obi-Wan did not know that Anakin had survived simply because he was isolated on Tatooine. Although Obi-Wan did not see Anakin die after their battle on Mustafar in Star Wars: Revenge of the Sith, he reasonably could have assumed that Anakin would die from his injuries. Since then, Obi-Wan had been living in exile on Tatooine. As a desert planet in the Outer Rim, Tatooine probably received little news from the rest of the Empire, so its inhabitants might not have known any concrete information about Darth Vader. Even if some people on Tatooine did know about Vader, they probably would not have discussed this with Obi-Wan, considering Obi-Wan lived alone and avoided interactions.
However, even if Obi-Wan was unable to receive news on Tatooine, it seems like he still could have sensed Anakin through the Force. While it was across much smaller distances, Star Wars has already set the precedent for using the Force to sense others. For example, Star Wars: The Last Jedi explained that no one was able to find Luke when he went into hiding because he had cut himself off from the Force. To protect both himself and Luke, Obi-Wan may have done the same. This is ed by Obi-Wan not using the Force at all during Obi-Wan Kenobi episode 1 and struggling to save Leia when she fell off a roof. Without a connection to the Force or news from the rest of the Empire on Tatooine, Obi-Wan easily could have not heard that Anakin was alive until the events of Obi-Wan Kenobi.
Obi-Wan Kenobi releases new episodes on Wednesdays on Disney+.