Fritz equal 💩 what's the origin of that slang?

Also used to mean something going haywire. Like my icemaker is on the fritz, but the fridge is fine.

In this case I think it simply rhymes with shits. Never heard it used in this manner, but why not.