The bike behaving strangely
Did you say strangely?
Wander is a sideways movement of the motorcycle. Unpleasant more than dangerous, there are generally solutions, unless it is a design fault (frame not rigid enough).
The first in line culprits are the tyres (worn or under-inflated), the suspensions (worn, badly adjusted or unsuitable for the load), the steering column (worn bearings).
By looking at these parameters we can return some of the stability to the machine. The riding position also plays a role : the rider wearing a somewhat roomy jacket, driving fast on a bike with no fairing, could be responsible for wander.
More unpleasant and dangerous than wander, head shake is both sudden and brutal.
This can happen on all motorcycles, but there are nevertheless certain pre-requisites : a motorcycle with a high torque engine (engine torque is the capacity to deliver the power instantaneously), with a rigid frame and short wheelbase will be more subject to it than a trail bike with its more flexible frame and less powerful engine.
Tyre wear, suspension adjustment (front fork too hard, or using worn oil) are aggravating factors. A steering damper can overcome the problem, but this often reduces the agility of the bike.
Shimmy is a type of head shake which occurs when decelerating and at low speed, when the motorcycle is switching from its "gyroscopic" type of balance to its natural "gravity" type of balance. Shimmy may be violent, and its cause is worn or unsuitable tyres or a worn or tight steering.
Worn tyres or suspension can also be the source of vibration with more far-reaching effects for your motorcycle. The good road-holding of a motorcycle is a question of balance between the different parameters: tyres, suspension, fluids etc. It just needs one of these parameters to change to upset everything. Imagine the head-ache, for example when refurbishing a used sports bike!