The low silhouette of the StuG III (7 feet high vs 9 feet) made it ideal for ambush tactics. Against the Americans it's likely going to be on the defense and well hidden. It will probably get one or two aimed shots off at an advancing Sherman before the M4 can return fire. The StuG III's 75 mm KwK 40 L/48 gun could penetrate the M4A1's front armor at 1000 meters or more (except the gun mantlet).
Unlike other, heavier Wehrmacht armored vehicles, the StuG III was built in large numbers, over 10,000 though the best information I have says only 1,600 were deployed on the Western Front. And it was mechanically reliable. Unlike heavier German tanks which look fearsome on paper but few were built and many broke down, Shermans faced a large number of Stug IIIs.
The most important variable is the M4A1's gun. Is it using the low velocity M3 75mm/L40 gun or the M1 76mm high velocity cannon? Despite its poor anti-armor performance, the 75mm was retained because of it's superior high explosive shell. US tanks spent most of their time fighting infantry.
If our M4A1 has the 75mm gun, it's in trouble. It will struggle to penetrate the StuG III's 80mm of frontal armor at 500 meters. It is seriously outgunned. Its best bet is to fire a white phosphorous round to blind the StuG III while the M4 maneuvers for a side shot, or withdraws and calls in artillery, or calls in a buddy to flank the StuG III. WP could even cause a German crew to panic and bail out believing their vehicle is on fire.
An M4A1 with the 76mm high velocity gun is in a much better position. With a normal AP shell they can reliably penetrate a StuG III at 1000 meters. With an HVAP (High Velocity Armor Piercing) shell they could do it at 2500 meters. Unlike the Germans, the US was well supplied with specialty ammunition. If they can see the StuG III, they can destroy it.
In a close range fight, the M4 has some clear advantages. Not only does the M4 have a turret, but it has a powered turret allowing it to put the gun on target fast. The StuG III lacked a turret and could only traverse their gun about 25 degrees, and had to do it manually, before they had to turn the entire hull, a clumsy operation after which the gunner would have to reacquire the target.
Armored vehicles, if they're smart, don't operate alone. They operate with infantry. Here, the M4A1 has the advantage. The M4A1 was well suited to fighting infantry with three machine guns (a 30 cal in the bow, another mounted co-axially, and a commander's 50 cal), two of which could be fired while buttoned up. The StuG III G usually had only one machine gun. It was mounted behind a gun shield on top of the vehicle meaning a crewman had to expose themselves to operate it. Some StuG IIIs were modified with a co-axial machine gun as well.
Unfortunately I don't have specific M4 vs StuG III statistics. For further reading you might look into Steven Zaloga's books particularly M10 Tank Destroyer vs StuG III Assault Gun. The M10 was built on the M4 chassis, and carried a 3-inch gun similar to the M4's 76mm. On the other hand, it lacked armor and had an abysmally slow turret.