To get the history of a transactions for an account, we have to traverse the whole chain everytime, but etherscan provides the entire history of all the accounts instantly.
Similarly it does the same thing for smart contracts, it gives all erc20 transaction history by giving us the whole 'Transfer' event log.
I was exploring Etherscan and was trying to implement these functionalities for a private network and was trying to find if these are some build-in functionalities to achieve this but it seems like it isn't.
There are several of these ether chain explorers and they are showing all the tokens in any particular wallet, hence keeping track of all token transfers from all public contracts. Now that is a lot of data tracking.
Also I couldn't find out how they are monetizing this service.
So, Is my assumption true?? How they do it. For the usage of similar features in private network, do I have to save and keep track of everything too?