It is entirely based on time employed, up to a cap:
"You’re eligible to participate in profit sharing after two years of working at Basecamp. You’ll accrue one share per month starting on your second anniversary at Basecamp, and you’ll max out your shares at 10 years. We calculate shares based on months of tenure so there’s no unfair cliff between being hired in December vs January."