How do electronic design tools work
If you really want to understand this, I highly recommend a book by Dr. Farid Najm, called "Circuit Simulation".  If you follow the exercises in the book you can code a working simulator by the time you get to the end of the book, and you'll have a great working knowledge of how to read in a netlist, set up the MNA matrix and solve it, while dealing with issues like convergence problems and initial conditions.  I was able to code a working SPICE-like simulator from scratch in a couple of weeks of spare time, with reasonably good circuit models just by following the exercises in the book.

Circuit Simulation