In Scala, a companion object is just an object that declared in the same file as a class that has the same name as the object. With this approach, the class is also known as the companion of the object.
A great thing about this approach is that the companions can access each other's private members (fields and methods). I think of this as them being married and sharing a joint bank account.