There are many varieties of both shallots and onions within the species Allium cepa. They vary in appearance in that shallots grow in clusters attached at the bottom and each onion is an individual. But there doesn’t seem to be a consensus as to which is stronger in flavor. Perhaps that is because as natural products each shallot and each onion is a bit different from others of the same variety due to the environment in which it was grown, its stage of maturity at harvest, and how it was stored.
You can certainly substitute onions for shallots or shallots for onions in recipes and the results will be delicious but there will definitely be a difference in flavor and texture. Shallots tend to soften and disappear into the sauce where onions tend to keep their identity. With a sweetness somewhere between that of white and yellow onions and a mellow flavor shallots are good raw as they usually have less “bite.” The biggest difference is in cost. Although they are easily available now, shallots were once considered a special gourmet ingredient for use in French dishes and still bring a much higher price.