If you don't set the "maximum server memory" for SQL Server, and do not reserve memory for the operating system, SQL Server will try to grab all RAM to data cache and avoid using storage subsystem, if the OS does not have enough memory because SQL Server is targeting more memory than available, then pagination will occur and it will affect the performance of the whole server. The OS will provide storage space as memory and storage has poor performance compared to memory. You can use performance counter "page file expectancy" to monitor how much your server is paging. All servers do some paging, monitor de counter for excessive paging.
Tempdb is not RAM memory, is all about storage subsystem (disk). Temporary tables, table variables created by users/applications are stored on tempDB. Temp tables are also used internally by SQL Server, When you have a spill from a query, SQL Server will spill that data on to temporary tables. If you are using read committed snapshot isolation level that allows users to read data while other users write data, tempdb is going to hold the version history of that data. If you are using AlwaysOn AG, and you are on a readable secondary, SQL Server is going to creates statistics and store them on tempdb when you query that readable secondary.
A query spill data to TempDB when it was not granted enough memoryto finish the operation and spilled over into the TempDB to complete the operation. Spill to tempDB (disk) hurts performance so you want to avoid query spills to TempDB