Do they check IDs while traveling from Stockholm to Tallin by ferry?
IDs typically aren't checked when travelling between Schengen countries.
However the border officials are fully within their rights to ask to see your ID so you should carry it anyway.
Going from Stockholm to Tallin I'd say a random check is less likely than the reverse however you should still have ID just in case.
I have been checked when going from Stockholm to Aland and on the Helsingor-Helsingborg ferry.
I will travel this route on the Viking line in early July. The booking confirmation that they emailed me included this: "Please remember to bring a valid ID on your trip. Please remember to have your passport at hand."
Added: I tried to, but was not allowed to, pass through the gate after scanning my boarding pass. An alert sounded, and I was required to show my passport.