One by one, alright.
We need the treatment history because it helps in planning a treatment for you. Let's say you've had all your wisdom teeth removed, then we're sure that you don't have unerupted wisdom teeth (unless for special cases), hence reducing the need to have an OPG (orthopantomogram radiograph, for an overall view of your teeth). And let's say you've had multiple extraction and fillings, then we know you're probably not the type that gets excessively anxious during dental procedures. Etc., etc.
For medical history, there are a lot of explanations on this. Let's say a patient has any infectious disease, then, the way we disinfect all equipments are different. Even the type of equipments used differs slightly. And for some diseases, they affect wound healing, blood clot formation, and etc. i.e; a patient with liver cirrhosis (liver badly damaged, its function is badly affected) will most probably have reduced proteins needed for a bleeding to stop, so we have to consult a medical physician to continue the treatment. For those with heart disease, we'll need to becareful because the bacteria released into blood during a dental procedure may cause infective endocarditis (infection of the heart), and we'd want to avoid those complications (this is only for a person who has heart disease okay) by giving antibiotics before starting the procedure. Allergy history is because some of the materials used in dental procedures may cause allergy reaction to certain patient, but this is quite rare, but is valuable.
Previous charting is to observe your progress and to look for which dental procedure should be prioritised.
There are many types of x-rays. OPG in an instance gives a rough overview of your teeth and is useful in knowing the eruption status of a patient. You get to see a part of your maxillary sinus (hollow cavities in everyone's skull) using this. Let's say you're getting your tooth extracted, then some tooth is closely associated with a few nerve. A dentist should foresee this in planning an extraction. For caries developing where two teeth meet each other, we'd just like to confirm whether there really is a caries or is it just an initial caries which does not require fillings to be done. Let's say a patient complains of severe toothache which doesn't stop for a long time, then we'd like to see the extent of the caries. For untreated dental caries, it may spread to tissue surrounding the tooth, but how are we going to see this without actually pulling the tooth out to see the structures underneath it? The answer is x-ray! A dentist has so many patients to treat daily, so you can't expect that dentist to have photographic memory of each and every patient he treats. So sometimes he needs photos. Sometimes, he may use it for research and etc. But he'll ask your permission first.
Consent forms are needed for legal purposes. A patient (or even a medical doctor and so many more services) must give consent to a treatment in order for a dentist to start his treatment. Let's say the patient is not happy with the treatment or its aftermath, then he may sue the dentist. And you'd want to avoid unnecessary legal issues as well as protect both patient and dentist's rights.