A disk can run out of inodes or a backup can crawl because one folder holds a huge number of small files. To find that folder, count files per folder.
find /var -xdev -type f -printf '%h\n' | sort | uniq -c | sort -rn | head
%h prints the folder a file lives in, without the file name. Every file gives one line with its folder, sort | uniq -c counts how often each folder appears, and the last sort puts the busiest folder on top. That gives lines like 3 /t/a and 1 /t/a/b.
This counts files directly inside each folder, not in its subfolders. That’s usually what I’d want, because it points at the exact folder that’s full, like a session or thumbnail cache, instead of a parent folder with a big total.
Two notes. Paths with a newline in them will mess up the count, since everything works per line; on normal systems that’s rare. And on a tree with millions of files, the sort step needs memory and temporary space. If /tmp is small, point sort somewhere else with sort -T /path/with/space.
Further reading: find(1) manual page, GNU findutils manual