Obi-Wan saw Luke Skywalker and his companions entering the Millennium Falcon and decided to allow Darth Vader kill him with a smile on his face. As he died, his body vanished into thin air, leaving only his cloak and lightsaber behind.
He could have still fought on but decided not to, why?