The package firebase contains all firebase services, you can check in the npmjs documentation:
The full Firebase JavaScript client includes support for Firebase Authentication, the Firebase Realtime Database, Firebase Storage, and Firebase Cloud Messaging.
// This import loads the firebase namespace along with all its type information.
import * as firebase from 'firebase/app';
// These imports load individual services into the firebase namespace.
import 'firebase/auth';
import 'firebase/database';
The other package @firebase/app doesn't contain all the services if you install it and try to connect to the database it won't work.