My daughter was diagnosed with asthma and shes 5 what could cause her to get asthma all of a sudden?

Known. There are many genes associated with an increased risk for asthma. As a result asthma is often associated with illnesses that precede it like eczema & food allergies. Then environmental factors play on these vulnerabilities to trigger asthma. Such factors include viral respiratory infection, pollution especially cigarette smoke & allergens like dust mite and especially around age 5 plant pollens.
Unknown. Nobody knows the answer. Some have theories. Stay tuned for more research.
Genetics. Asthma can star at any age. There are certainly family histories in many if not most cases. The triggers to start the wheezing are different. But you can start with symptoms anytime.
Asthma. Difficult to diagnose younger than age five. Most importantly, if she does have asthma, she needs treatment regardless of what caused it. See an asthma specialist.
Emergence/ label. Many of us are leary of using the asthma label in younger kids as so many of those that wheeze in infancy/toddler years will grow out of it by 4-5 yr.Those with genetically mediated asthma can emerge at any age, but boys seem to do so earlier (about 1) while girls do later (around 4). Most will have a set of triggering factors(URI's, weather change,etc).She likely followed a preset pattern.