You can use the Sort By feature in View > Show View Options to keep a folder's contents sorted and thereby both eliminate empty space and prevent icons from stacking.
MacOS Finder - Hidden files covering up non-hidden ones
You can use the Sort By feature in View > Show View Options to keep a folder's contents sorted and thereby both eliminate empty space and prevent icons from stacking.