Auto assignment is based on the closing price on the day of expiration. But where it gets a little murky is that the option buyer has that narrow time prior to the deadline where he can look at things like after hours or earnings releases and decide to do something different than what the auto assignment would do. This is why closing options rather than letting them expire is often a good idea. Then you are sure a surprise can’t happen after market close.