To a pre-schooler a friend is someone sitting beside you that likes to play the same toys as you do. That you can go sit by all the time and play those toys. Like in the sand box every recess at pre-school. Outside of that sand box they'd have little in common and probably not play together.
At age 5 it's similar but they are starting to recognize personalities and starting to understand interpersonal communications and who they like to be around. They probably won't remember and want to seek out these friends after school is out for summer unless they interact with them outside of school during the year, such as friends at church or scout like groups, clubs, etc....
At age 7 they are making friends they'll remember their whole lives. It's unlikely they'll still be friend in the higher grades though because they are just starting to find their own likes and dislikes, personality traits they like and dislike, and who they enjoy being around.
At age 7 my granddaughter had a very close best friend. They did everything together outside of school because they went to different schools. My bff and her daughter were our best friends. We were always doing stuff.
As the girls got older, even a year, they started showing signs they weren't as close as they had been since age 2. They were starting to like different music, different styles of clothes, phrases they always said, and so much more.
Now they see each other every now and then and are like long lost siblings, hugging and missing each other a lot. But after about an hour they're ready to be apart again. Absence makes the heart grow stronger but absence also makes the heart forget.
Kids will change groups and friends many times as they grow up, they have a lot of changes they go through. It's hard sometimes to see someone you love and like being around decide they don't have anything in common with you anymore and would rather go play with someone else.