An IEP is specifically for kids who have developmental disabilities. These are often Down's Syndrome, Mental Retardation, and other disabilities that impact their lives in more than 2-3 life skills areas.
If a child has a learning disability that does not specifically mean they qualify. They need more than just one cognitive issue. It's more than that. They need to probably qualify for special ed classes, some schools don't have those so they streamline their students. In this case they might need to have an aide with them to help them with toileting or to help them with feeding. Again, they need to have disabilities in more than one life skill area.
A 504 is a plan that is made by a group consisting of the teacher, principal, school psychologist (Sometimes), the parents, and any other professionals the team/group feels is needed. The goal is to make sure that the child has a successful year.
Kids with seizures, ADHD, behaviors, juvenile diabetes, asthma, or any other health issue, and many other reasons often need the staff of the school to be aware of issues so they can help that child to make good decisions.
For instance, my grandson had a 504 plan. He is ADHD. In pre-K he had behaviors and needed an aid in the classroom to help the teacher. So the teacher could teach the class and the aid could do one on one time with a couple of boys that sometimes needed a bit more guidance. There as also a regular aid in that room too.
In kindergarten he did fine and had help at lunch to make sure he sat down and ate something. His meds make him less hungry. He just has to be encouraged to eat something. He needed help going to the office and getting his meds because they might find him playing basket ball in the gym all by himself if someone wasn't letting the office know he was coming and then the office let the teacher know he was on his way back to class.
They helped guide him without having someone there holding his hand.
My friend has a daughter who has seizures. She has a 504 plan because she might need immediate medical care at any second. Several staff are specifically trained to deal with her seizures and can spot when she's about to have one/starting to have one. They are on her team and know what meds she takes, what is normal and what might be a serious problem. They are there to make sure she is not embarrassed by falling down in the middle of the hallway and flopping around foaming at the mouth and then having to face her peers the next day. They have a plan to keep the hallways clear by keeping classes in place if something like this happens.
A 504 plan is a plan to help that child in any way the school can. Once they have that plan in place they can get more funding to pay extra staff and they can do a lot more for that child. It's a good thing to have.