I guess you have a confusion on how lower_bound works, lower_bound returns the index of first element that is not smaller then than given element.
Eg: arr[]={2,4,6,8,10}
val=5
now int it=lower_bound(arr,arr+5,val)-arr;
(it is equal to 2) position of 6 first element not smaller than 5
if arr[]={2,4,5,6,8}
val=5
now int it=lower_bound(arr,arr+5,val)-arr;
(it is equal to 2) position of 5 first element not smaller than 5
So If our aim is to find the first element not smaller than given value,then there is no need to subtract. But if we are aiming at finding the element just smaller than given element we will need to subtract.
@yashuanshu0 I hope this clears your doubt.
If this resolves your doubt mark it resolved.