applications – How to merge two applications into one application


I know this question has already been asked, but the answer still does not satisfy my thirst for knowledge.
I want to merge two applications into one application. Suppose we include B (app) in A (app). Yes, I know I can import one as a library, but the reason for my question is this.

For the moment, everything is in confusion and I would like a clear answer so that generations of people can benefit from this question. Thank you !