title: How do BLE/BT pairing and bonding work with wearables?
body: <p>How does clicking a button on a wearable or moving a phone (client) near the wearable (server) automatically pair the phone and the wearable together?</p>
  <p>For example, simply bringing a phone near the Nike Adapt BB shoes connect the phone and shoes together, simply opening the Apple Airpods case triggers a connection notification on the iPhone, and simply scanning the Apple watch face connects the Apple Watch and an iPhone.</p>
  <p>My theory around this is that clicking &quot;Pair&quot; on an App triggers the app to run a BT scanning code file. At the same time, clicking a button on the wearable initiates the advertising sequence. And the two devices pair due to some commonality between them. I'd like to know what this commonality is. And what happens in the case that there is no button on the wearable to click? And lastly, how can I start making this system? I'd like to make an app that says &quot;pair&quot; and connects to some BT device (headphones, speakers, wearables, etc).</p>
  <p>To give you more clarity, I am trying to connect an ESP32 (server) to my phone through an app (client) I create. I'd like to achieve a process where simply bringing the phone running the app, near the ESP32 pairs the two devices together or clicking a button on an ESP32 pairs the ESP32 to an app running on my phone.</p>
  <p>Please let me know if you have any questions. Thank you in advance for helping me understand this.</p>