They’re not being put back on the bookshelf just yet. Very often, those sefarim that are currently in use, end up in a stack. Does the stacking order matter? Yes, it does!
From top to bottom:
1) Chumash – You may put one Chumash on top of another.
2) Neviim and Kesuvim are on the same level, and there is no problem with putting one on top of the other.
3) Torah She’ba’al Peh – You may put one Torah She’ba’al Peh sefer on top of another and even Acharonim on top of a Gemara. (Rav Elyashiv, zt”l, was machmir not to put Acharonim on top of Rishonim. But within the Acharonim, there was no preference of age.)
There is a dispute within the Acharonim regarding a siddur. Some say the siddur has the status of #2 (Neviim and Kesuvim). According to this ruling, you cannot put Torah She’ba’al Peh on top of a siddur, especially since today’s siddurim include pesukim of Chumash for the Monday and Thursday kriyas HaTorah. But some say that a siddur has the same status as #3 (Rav Elyashiv, zt”l, was of the opinion that a siddur should be in a separate pile and not to put Torah She’ba’al Peh on top of a siddur, and vice versa.)
What about other items on your sefer?
It is prohibited to top any sefer with mundane items, except if the item is for the purpose of the sefer (like the cover). Also, it is permitted to place items like a paper and pen on the sefer while one is learning, as they are there for the purpose of learning the sefer.
If the sefer is inside of a box or bag, you are permitted to place items on top. (Rav Chaim Kanievsky says it is best to be careful, even when sefarim are in a box.)
Source: שלחן ערוך יורה דעה, סימן רפב, סעיף יט