Why is ERPNext required to be installed to use FrappeHR

In the installation instructions for frappe HR, it says that ERPNext app should be installed before installing HRMS. What is the reason for this? Can we use the HR app without installing ERPNext?

Can one frappe app depend on another? If so, how does this work out? Is code or data somehow shared between them?

Maybe Frappe HR depends on or builds on features added from ERPNext

Shortest answer is Yes.

Of course, The ERPNEXT app is required when setting up HR app.
Because the HR app needs to call many classes and methods that are in ERPNEXT

The ERPNext dependency is primarily for accounting (payroll, claims, advances). If you don’t need those features you can ignore ERPNext’s accounting setup.

We are actively working on making the UX better for both type of users.