Faster query using temp tables

Thank you mike01
But I don't understand what do you mean:"temp tables only contain the data you were looking for".
The queries were performed against the same database but the first one was with subqueries and in the second case I first created temporary tables (#temp1, #temp2...), populated them with the same queries as the subqueries and the select was joining on the temp tables, not on subqueries.
That's the scenario: Join on subqueries vs 1.create temp tables + 2.populate them with the same data as the subqueries + 3.join these temp tables
I stress again: the same data as the subqueries (I just copied the subquery and used it for the Insert into #temp1 Select [subquery here]

Thank you for answering.