What is the difference in (alc) and (aq) states in reaction mechanism?

![enter image description here](https://i.stack.imgur.com/auCGp.jpg)


In these reactions between alkyl halide and KOH in different states the product is different only because of the change in state of KOH from aqueous and alcohol . 


Can someone explain the mechanism which causes this drastic change?




Nucleophilic substitution always competes with Elimination reaction in such cases.


What is the difference between them?


[As put there by philipp:](https://chemistry.stackexchange.com/a/15737/36173)



> 
> In alcoholic solution the $\ce{KOH}$ is basic enough ($\mathrm{pK}\_{\mathrm{a}}$ 15.74) to deprotonate a small amount of alcohol molecules ($\mathrm{pK}\_{\mathrm{a}}$ 16–17)), thus forming alcohlate salts $\ce{ROK}$. The alcoholate anions $\ce{RO-}$ are not only more basic than pure $\ce{OH-}$ but they are also bulkier (how much bulkier depends on the group $R$). The higher bulkiness makes $\ce{RO-}$ a worse nucleophile than $\ce{OH-}$ and the higher basicity makes it better at $\mathrm{E}2$ eliminations.
> 
> 
> 


Mechanisms below:
[![enter image description here](https://i.stack.imgur.com/Bi5pl.jpg)](https://i.stack.imgur.com/Bi5pl.jpg)


[![enter image description here](https://i.stack.imgur.com/23mEc.gif)](https://i.stack.imgur.com/23mEc.gif)


 2