There are two objects in my 3D-view:

* A red object
* A white object

Both are overlapping each other.

I have added several keyframes of animation to the red object. 
When I select the white object, all keyframes disappear from timeline.
They reappear if I select the red object again.

Why do keyframes disappear from the timeline?  

What am I missing?