How is the cost of a query calculated and what parameters are determining the final number


We would like to understand how is the query cost calculated and what are the parameters taking into account as we’ve noticed some simple queries are having a cost within billions despite that there are no calculations or any logic in the SQL definition and all it does is just a SELECT * from a table with no more than 2M records.

Thank you,