Maybe not $300 but I can get a sony xperia xz2 compact for 3000 NOK ($345ish). Sony makes the cameras in many other phones including iphone.
I have the larger version, but my wife has this and it takes excellent photos.
And in the case of iPhone, the software takes advantage of custom-made, powerful, performant, and yet efficient chips that would make snapping photos take forever on older or non-specialised chips.
The physical focal length of a phone lens is about 3 to 4.5mm. There's not a lot of light-physics you cam do in that much space. Even a cheap point-and-shoot fixed-lens camera will be superior and will cost much less than the phone upgrade increment.