I have used several websites to generate color schemes including Adobe color, coolors.co, etc. All of them generate only 5 swatches per scheme. I want to know exactly, why is the number 5?
There aren't just 5 colors in a color scheme. Sometimes there's only two colors. Sometimes there are many more than five (when shades of the primary few colors are included as well, for example).
The number of colors in a color scheme should be part of the design process for a given project. Personally, when I'm designing something, I don't try to decide the colors I'm going to use for the most part until late into the project. I like to work in blacks and whites until I get most of the pieces I want fleshed out, then I go back and add as much or as little color as needed. As such, I never really choose a specific number of colors in my palette, but I rather end up with a certain number at the end of the design process.
 Sometimes I play around with colors to decide the feel I want in order to design pieces in a certain way, but I rarely decide on a particular palette of colors early on in the process.
As for why certain color generators only generate 5 colors, we can't really answer that because we're not them. Other generators generate other amounts of colors.
The most popular types of algorithms for picking color schemes from the color wheel are analogous, complementary and triadic. All of them imply an odd number of colors, e.g. the main color with at least other two colors (opposite or neighboring), and two additional colors to them, if necessary.
According to the four-color theorem, you need at least 4 colors to unambiguously denote objects on the screen (or on the surface of a 3D sphere in general).
Combining both requirements, you come up with the five-color schemes as the most abundant ones. Another argument in favor of that would be that historically cartographers developed color maps consisting of 5 colors as a century ago only the five-color theorem has been proven (although five-colored palettes are used for maps these days).