The ending to Angel Beats confused you? XD
Otonashi and Kanade's whole deal was that.. when Otonashi died he made a point to be an organ donor. Around the same time that he died Kanade was sick and needed a heart transplant. She was given Otonashi's heart, and her reason for being part of that spirit world was to thank Otonashi for giving her longer to live.
When she stabbed him in the first episode she noticed he had no heart / heartbeat, and so she knew who he was from the get-go, but didn't tell him until the end. He had no heart because it was inside of her. There was an episode where he got his memories back, and that was because he fell asleep on Kanade, and his body reacted to hearing his own heartbeat from her. o.o