Oracle use two engine for execution of PL/SQL programs:
- PL/SQL Engine
- SQL Engine
During execution of PL/SQL program to execute all procedural statements (like if, for, assignments...) Oracle use PL/SQL engine and sends all SQL statements present in the code to the SQL engine. The SQL engine will parse and execute the query or DML statement and return the expected output back to the PL/SQL engine. This switch between the two engines is called context switching.
Which impose additional overhead like maintain the state of variables and stack on every switch..... means highly expensive. Specially the cursor loops are very expensive so instead of that one should use Bulk Bind and Bulk collect features which reduce context switching.