Jeremy Bentham famously defined a legal fiction as "an assumed fact notoriously false, upon which one reasons as if it were true." He gives as examples arguments by jurists that for certain purposes in wills the deceased and the heir are the same person, that corruption of blood from capital crimes prevents inheritances, that the king is everywhere present and can do no wrong and is immortal, that society is based on a social contract. Needless to say, he does not approve of legal fictions; he says in one place that in English law, legal fictions are syphilis, rotting the whole system. It has been pointed out (by Stolzenberg particularly, "Bentham's Theory of Fictions - A 'Curious Double Language'") that Bentham does allow some role for fiction; he thinks that language requires fiction, for instance. But in law, he is generally quite vituperative about them.
Most discussion of legal fictions derives from Lon Fuller's major discussion of it, published in three articles beginning in 1930 and in a book collecting the articles in 1967. Fuller argued against Bentham that in fact legal fictions are essential to law. He himself, however, characterizes fictions are falsehoods that are recognized as having utility. Generally people follow Fuller in regarding legal fictions as something counterfactual. I would suggest, however, that this is already to concede too much to Bentham. The root idea of 'fiction' is not falsehood but construction, and legal fictions are legal facts that are not received from an extralegal context (as non-fiction facts are) but instead constructed specifically for the purposes of law. In many situations, constructing something rather than discovering or receiving it is connected with falsehood, but this is not true with law.
When we say, by legal fiction, that a corporation is a person, what we mean is not the false assertion "A corporation is a person" as it would be understood outside of law, but something that can only be correctly asserted withing a legal context. We might even in fact phrase it as "A corporation is a person for the purposes of law". When we say, by legal fiction, that the husband and the wife are one person, we are not speaking metaphysics but law, and in law it may be so. What makes it fiction is that we hold these things, not because we have discovered them to be facts, but because we have made them facts about law. Legal fictions are legal facts had not by practices of discovering facts independent of law, nor by practices of trying to approximate some legal measure for some extra-legal fact, but by practices of creating a fact in the legal system. Legal fictions are not false but artificial. They are not counterfactual but non-natural.
This is why legal fictions are not lies, not (as Bentham would have it) dishonest deceits. Fuller treats the difference as simply intent to deceive, but, as has been noted in the ethics of lying, one may deceive without intending deceit. But legal fictions do not deceive at all; they are the way things are, given how we have set up our legal system.
This is also why legal fictions are unavoidable. Laws have to be concerned with practical matters; their classifications must therefore be governed by practical considerations. All legal classifications are artificial classifications created for practice. Now, and again for practical purposes, we need artificial classifications to have some connection with a natural classification, but at times practical considerations will be better served by diverging from natural classification. In biology we may need whales to be mammals; in law, as Whewell noted, it may make more sense for whales to be counted as fish. In metaphysics, we need to distinguish persons and corporations; in law we may need corporations to do things that, in our legal classification, persons do. And when we have so classified them, it is not false to say that they are so classified, no matter how artificial the classification.
There is nothing in this that is different from law in general. If we make the speed limit on a stretch of road 60 mph, it is a fact that the speed limit is 60 mph, despite the fact that no physicist could discover 60-mph-ness in that stretch of road. It is not false; it is true that the speed limit, as a matter of fact, is 60 mph. It is an entirely artificial fact, but it is a fact nonetheless. While law does (and must) sometimes receive its principles from outside itself, much of law is artificial, and does not exist except for the fact that we have made it so. And when we have made it so -- lo! it is a fact that it is so.