Pentax changed the way the aperture lever worked from M to A lenses. Moving the lever say 0.5mm moves the aperture blades one stop, for its full range of motion. The contacts tell the camera what the lens's aperture range is. For example the Pentax-A 135mm f2.8 opens to f2.8 and stops down to f32. Then the camera knows how to set each aperture precisely through that range.
Older lenses don't have to have a precise aperture lever. The lever just moves the blades between wide open and wherever the aperture ring is set. The older cameras could see the position of the aperture ring and use that for metering. Those cameras have an arm that moves the lever, but it always moves the lever 100%, not in tiny increments like recent cameras.
If you swap mounts, the camera will see an A lens and expect the A aperture arm movement. Metering will be right sometimes, wrong at other times. Maybe you'll get lucky.
The conventional wisdom is that it's not worth the trouble.
I had some photos of each lens so I include them:
A50/1.7:
A50/1.4:
M50/1.4