A typical activity is a single, focused action a user can take. Nothing is stopping a developer from creating an activity that is arbitrarily complex, though, at the same time.
The Fragment class is an optional component that activity implementations can use to produce more modular code, create more complex user interfaces for larger screens, scale applications between small and large screens, and other things.
The same fragment can frequently be used across different activities, and multiple fragments can be combined within a single activity. The main goals of this structure are to encourage code reuse and promote economies of scale.
A fragment is a modular portion of an activity with its own input events and lifecycle and can be added or removed as needed. But it's important to keep in mind that the lifecycle of its host activity directly impacts a fragment's lifecycle; in other words, when the activity is paused, all of its fragments are paused as well, and when the activity is destroyed, all of its fragments are destroyed as well.