In macOS, the “Show suggested and recent apps in the Dock” option adds a divider to the right side of the Mac’s Dock, and then shows recently used apps or apps that macOS thinks will be useful for your workflow, but not permanently in the dock.
Change the number of recent apps shown in the Dock with the Terminal command
When there are no currently open non-docked apps, the right side of the divider shows the three most recently used apps that are closed. However, it is possible to increase this number, and it is useful for those who use many non-docked apps in a row in their workflow.

Users who know how to paste commands into Terminal can increase or decrease the number of recently opened apps shown in the Dock.
Open a Terminal window (the application is located in /Applications/Utilities/) and paste the following command into the command line and press Enter:
defaults write com.apple.dock show-recents -bool true; defaults write com.apple.dock show-recent-count -int 10; killall Dock
The -int argument defines the number of recently opened applications that you want to display in the Dock after the separator (10 in this example). The number can be changed as needed, and you can switch back to showing three applications at any time by using -int 3 in the second command.