The pencils at first were 18. Students borrow some and this number is not given, but we can call this number x (that is, unknown).
6 pencils are left at the end of the day, and this means;
That means 12 pencils were borrowed.
Also answer option 2 is the correct equation to arrive at the correct answer