I have a function which returns a table.
If you run SELECT * FROM some_function(12345) the result is:
SELECT * FROM some_function(12345)
object_id | name ----------------
SELECT * FROM (SELECT some_function(thing_id) FROM things) x;
The subselect SELECT some_function(thing_id) FROM things returns a row for each record found. The outer select "uncompresses" the row into separate columns.
SELECT some_function(thing_id) FROM things