The chemistry is dead simple - those proteins aren't actually being destroyed, just forced out of hiding. Milk's casein proteins normally float around suspended because they've got a negative charge that makes them repel each other, but acid (from lemon or vinegar) neutralizes that charge and lets them clump together into solids. It's totally safe to eat, and yeah, that's literally how ricotta and paneer exist, but here's what people gloss over: the temperature matters way more than you'd think. If your milk isn't warm enough (around 90°F or so), the curdling happens slower and the curds stay smaller and softer, which changes your whole finished product. Push it too hot and you get tough, rubbery chunks instead of the tender curds you're after.