What is a Scooter?
Well, here's what Wikipedia has to say:
A scooter is a style of two-wheeled motor vehicle traditionally defined by characteristics such as a step-through frame, wheels less than 16" in diameter, and an engine located below the rider and to the rear.
That pretty much sums it up. Motorcycles have an engine mounted in the middle of the frame with a gas tank above it. The rider sits astride the engine with the gas tank right in front of them. Motorcycle wheels are also typically larger (over 16" diameter) than those on a scooter. Another major difference is that the engine of a motorcycle is attached to the frame, while on a scooter it is usually part of the rear suspension. So when a motorcycle rear wheel goes up and down, the engine remains stationary, while when the rear wheel of a motor scooter goes up and down, the whole engine and transmission moves up and down with it.
These days, 99% of scooters have a "twist and go" automatic (CVT) transmission, which means you don't have a clutch to control and you don't have to change gears, while 99% or motorcycles have a manual clutch and you have to shift gears manually (with your left foot). This also means that on 99% of motor scooters you apply the rear brake with your left hand, while on 99% of motorcycles you apply the rear brake with your right foot. While there are still a few manual scooters and there are a few automatic motorcycles, both are very much the exception rather than the rule.
These differences result in a motorcycle usually having better acceleration high speed handling characteristics, but a motor scooter is often more manouverable at low speed and is easier to ride, especially for novices.
Scooters usually have a small engine, from 50cc to 250cc, though there are 400cc and even 800cc scooters, so engine size doesn't define them. While most are limited in speed, scooters with a larger engine can exceed 100mph and cruise easily at freeway speeds, so speed isn't a defining characteristic either.
So what is a moped then? That's a little trickier, but the working definition for most DMVs is a motorized two wheeled vehicle with an engine of less than 50cc capacity. It used to be that a moped was a MOtorized PEDal cycle, i.e. basically a bicycle with a small engine, but some jurisdictions don't require pedals. Again we can also look at Wikipedia for a definition:
Mopeds are a class of low-powered (under 50cc displacement) motorized vehicle, generally two-wheeled. A Moped is driven in an upright position with the rider's back perpendicular to the seat.
From a practical point of view, in most jurisdictions mopeds can be ridden without requiring a motorcycle license (a car license is sufficient). They may be speed limited by design, but even if they aren't, the small engine size usually limits then to a top speed under 40mph (maybe 45mph downhill with a tail wind). In the United States the definition and regulation of mopeds differs from state to state. Again calling on Wikipedia...
Legal terms and definitions of low-powered cycles vary from state to state and may or may not include "Moped," "Motorcycle," "Motorized Bicycle," "Motorscooter," "Goped," "Motor-Driven Cycle," and or others. A moped's speed generally may not exceed 30 mph (48 km/h) on level ground, even if it is capable of going faster. In a few states this number is 20 or 25 mph (32 or 40 km/h), and in most states, the maximum engine capacity is 50 cc. However, Kansas ("Motorized Bicycle" K.S.A. 8-126, 8-1439a) allows up to 130 cc. Some states, like California, require pedals, while others do not. Virginia allows mopeds to operate at up to 35 mph (56 km/h). Some states, like North Carolina, require there to be no external gear-shifting mechanism.
New Jersey for example requires a moped must have pedals, not exceed 25mph on level ground, be under 50cc and have less than 1.5 horsepower. In NJ a scooter with an engine smaller than 50cc is classified as a motorcycle, but is exempt from the motorcycle inspection requirements.
So as you can see, mopeds can be many things and what's a moped in one state may not be a moped in another. As a matter of interest, the world speed record for a 50cc motorcycle over a 1 mile track is 137.9mph - but it wasn't a street legal moped! Note that in most (if not all) states, you cannot legally ride a moped on a freeway since they are not capable of operation at freeway speeds and would be an obstacle to traffic.
In some states a moped and a scooter may look identical, but the one with an engine of 49cc gets "moped" license plates while the one with a 150cc engine gets "motorcycle" plates and requires a motorcycle license to ride.