Banks do close inactive accounts. The process is called "Escheatment" (I think
I've got that right), and the laws, which are vary specific, vary by state in the US
and by whatever government entity elsewhere. The banks do not get to keep the money,
however, it is (usually, anyway, again the laws vary) normally turned over to the state,
where it remains available on some basis should it be claimed (which is fairly rare).