The Liberal Democrats were the third largest party until the 2015 United Kingdom general election when they were overtaken by the Scottish National Party in terms of seats and UK political party membership , and by the UK Independence Party in terms of votes .