It uses the << operator to write object and then ss.str() into the stream.
Note that ss.str() gives a copy of the current content of the stream's internal buffer as string.
Since the << operator returns a reference to the stream on which it has been applied, you can "chain" these operators and/or assign the final result to a variable.