The unanimous requirement was changed by the Criminal Justice Act 1967[1] (the relevant section since repealed) for criminal proceedings and the Jury Act 1974[2] for civil proceedings (incorporating criminal proceedings as well).
It's unclear why the number was originally set at 12 – historical research suggests the Danes set this number when they conquered parts of northern England and subsequent Anglo-Saxon monarchs simply continued it. Perhaps 12 was simply an appealing number, or maybe there were political considerations, etc. — it's impossible to know.
As for why Parliament allowed juries to come to a non-unaninmous verdict in specific circumstances, it appears to have been influenced by the Morris Committee Report of 1965 according to Hansard[3].
Additionally (as mentioned in Hansard above), the Scottish legal system have had majority verdicts for juries for a long time prior to the change to England and Wales in 1967 so that may have had some influence on the Government of the day implementing a change to the jury system.
Part of their concern was also down to "jury nobbling" - they felt that if one or two people were "nobbled", it would be fair to allow the remaining 10 to come to a verdict effectively disregarding the nobbled pair (this is also raised in the Hansard report above).
-- [1] http://www.legislation.gov.uk/ukpga/1967/80/section/13/enact...
[2] http://www.legislation.gov.uk/ukpga/1974/23/section/17
[3] https://api.parliament.uk/historic-hansard/commons/1967/apr/...