Where does istatedb save state?

Hi, I am just wondering difference between using istatedb and local storage. Could you please enlighten me with information or link to read more about the topic? Thanks