The reaction of Williamson synthesis involves SN2 attack of an alkoxide ion on a primary alkyl halide
But if secondary or tertiary alkyl halides, then elimination would compete over substitution. As a result, alkenes would be produced. This is because alkoxides are nucleophiles as well as strong bases. Hence they react with alkyl halides, which results in an elimination reaction.