What compiled collection of reusable SQL statements and control-of-flow logic defines a stored procedure within modern relational database systems, and why is executing pre-optimized transactional routines directly on the database engine essential for minimizing network latency, securing data access, and enforcing consistent business rules across distributed enterprise architectures?