That’s something that iOS 15 will be exploring in a new Health feature called Walking Steadiness. According to Apple, “Walking Steadiness on iPhone is an industry first, providing insight into fall risk by capturing important mobility data as users walk with their iPhone. […] Walking Steadiness offers the added ability to capture everyday movements and surface classifications within the Health app as OK, Low, or Very Low, allowing users to proactively take action to help reduce their risk of falling.”
This feature uses sensors that are already built into the iPhone and combines it with custom algorithms that will assess the person’s balance, stability, and coordination. It can also help with a person’s fitness goals where depending on how well the phone scores your walking, you might be directed to visual exercises that can help you increase your strength and balance.