A firm is a place or organization that handles affairs. Nowadays, most of them take over other people's entrustments and become "firms", which is used to refer to the FBI.
As the name suggests, it is a place that handles affairs. Most of the places and institutions now take over the entrustment of others and become "companies".
For example: detective agency, law firm, accounting firm, trademark firm, tax accounting firm, logistics firm Offices, etc.