The lag-screw size required is determined by the load they must transfer from the rack to the roof structure. The same loads also determine whether the roof is strong enough to support the array.
The most critical loads on the roof attachments often occur at the rear leg when the wind is creating uplift on the collector the lag screws hold down the rack as the rack tries to pull away from the roof. There is also a shear force that pushes perpendicular to the length of the lag screw.