If I had to guess, the seller tells Amazon where the product is located + their shipping cutoff time, and if the customer is in a geographic location that is serviced by UPS/FedEx/USPS from the seller's warehouse with 2-day transit time, and it's before the seller's cutoff, the Prime badge is shown.
More information here: https://services.amazon.com/services/seller-fulfilled-prime....