To look at and fill the view with selected objects
You can also choose
from the main menu, or press Shift+F, to frame all selected objects in all views.View > Frame Selection frames only the parent objects without their children. You can choose to frame both the parent objects and their children by selecting the View > Frame Selection with Children option. See Frame all or selected objects in a view.
By default, this value is set at 95%. You can adjust this value to determine how closely the camera should zoom into the objects when framing selected or all objects. Adjust this default Fit factor value in the Preferences window (Windows > Settings/Preferences > Preferences), Settings sub-section, Cameras section.
You can also override this setting for a particular instance by using the viewFit command. For example:
viewFit -fitFactor 0.8
This command moves the camera so that its view is filled with the selected objects, and when doing so, 80% of the view is filled.
The value you set for the fitFactor flag when executing the MEL/Python command takes precedence over the value set in the Preferences window.