why doesn't this clause invalidate state laws that provide for the selection of electors by popular election?
Because
in such Manner as the Legislature thereof may direct
means they can make their own state laws.
Regarding the 1st question
Does this mean a state legislature, could at any time, choose to appoint electors regardless of public election results and state laws.
That also depends on the state's own constitution etc., especially the "at any time" part. Some (state specific) process would have to be followed e.g. for changing the state's law.
Regarding this last q
As I understand, legislatures can establish their own internal rules, which would govern any exercise of their non-legislative powers, but it's not clear to me that a legislature must be bound by law in their exercise of those powers. I'm looking for answers to that question, one way or the other, ideally backed by precedent or historical examples.
If Congress could just ignore its own laws as (not) applying to itself, why do you think they bothered to carve explicit exceptions for Congress from numerous laws like OSHA, FOIA, etc.?
And with regard to state legislatures "changing their mind" with respect to electors already sent, that's also subject to
constraints from federal law (3 U.S. Code § 5)
If any State shall have provided, by laws enacted prior to the day fixed for the appointment of the electors, for its final determination of any controversy or contest concerning the appointment of all or any of the electors of such State, by judicial or other methods or procedures, and such determination shall have been made at least six days before the time fixed for the meeting of the electors, such determination made pursuant to such law so existing on said day, and made at least six days prior to said time of meeting of the electors, shall be conclusive, and shall govern in the counting of the electoral votes as provided in the Constitution, and as hereinafter regulated, so far as the ascertainment of the electors appointed by such State is concerned.
Basically, States can't "take back" (or change) the electors retroactively after Election Day. They could have conceivably changed their state laws or even appointed the electors (directly by state legislatures) before Election Day.
Actually, what you seem to be taking about here has been (somewhat derisively) called
"legislative superpower"
and it was actually proposed by a minority of the US Supreme Court. Notable proponents include Rehnquist (in the past obviously) and Kavanaugh now. So, if this somehow reaches the Supreme Court again, given the current more right-wing bias of the Court, maybe they would strike down 3 USC § 5, who knows...
The actual controversies in which Rehnquist (then Kavanaugh) opined were actually a bit different, namely whether
legislature was to be interpreted narrowly (only as the elected body) or if it extended to the state's courts, i.e. whether the latter were allowed to interpret the state's laws in this matter. There was no actual case brought in which the state legislature (narrowly defined) actually changed the electors. So you could say that is (totally) untested.
The issue (of how extend that to post-election override) has been hashed a bit in the media by law academics, e.g.:
In Bush v. Gore, the Supreme Court interpreted that power to mean that the legislature could vest the selection of electors in the people — through a popular election — but that it could “take back” that power “at any time.” On Levin’s reading, “at any time” includes after an election. So that after an election, the legislature could say, “Thanks for your input, but we’re going a different way.”
In fact, in Bush v. Gore, the Supreme Court was saying something very different. The court was certainly affirming a special role for the legislatures in selecting electors. And it may well have been affirming that a legislature’s power could not be controlled by state law. For example, the Colorado Constitution requires that the electors be chosen by a vote of the people. On this reading, that constraint would not actually constrain the state legislature. Colorado legislators would be free to ignore their state constitution and pick electors on their own.
But such a decision would have to be made before the election, because of a second part of the Constitution that Levin has overlooked. As well as giving the state legislatures the power to set “the manner” by which electors are chosen, the Constitution also gives Congress the power to decide the day (the Constitution actually says “time”) on which electors are to be appointed. That day this year was Nov. 3. And if any state selected its slate of electors on a day other than Nov. 3, it would violate federal law, and that slate could therefore not be counted.
Somewhat more cautiously a 2019 paper argues that such an override would be a violation
of the Due Process Clause (14th Ammendment) e.g. because courts held that
"[if] the election process itself reaches the point of a patent and fundamental unfairness, a violation of the due process
clause may be indicated", but that only if there were not
extenuating circumstances like e.g. a natural disaster that made the normal (state-law prescribed) election
impossible. Such an exemption is actually provided for in federal law itself:
Congress itself has explicitly recognized that “the electors may
be appointed on a subsequent day in such a manner as the legislature of
such State may direct” if and when “any State has held an election for the
purpose of choosing electors, and has failed to make a choice.” [3 U.S.C. § 2.]
(More extensive works have been written on how courts have interpreted due process in the context of elections. While SCOTUS itself has never explicitly applied the Due Process clause to an election matter nor held that liberty under the 14th Amendment includes the right to vote, lower courts have done so. On the other hand SCOTUS itself has "often waxed romantically on the profound importance of the right to vote in general" as it has e.g. in several passages of Reynolds v Sims.)
Ultimately, the 2019 paper argues that in case of competing slates of electors
from the same state, it comes down to a (political) decision in the US Congress
which of them to count. (The pressures we saw Trump put on Pence basically illustrate that.
In the latter context, the Electoral Count Act (3 USC chapter 1)--which Pence followed--has also been declared unconstitutional
by some lawyers (and long before 2020) imputing it such long list of constitutional violations that it would be really distracting to even summarize them here. In some sense, that's a parallel debate to the one on what state legislatures are or aren't allowed to do with respect to electors. Suffice to say that the Electoral Count Act hasn't been found unconstitutional by any court insofar, as far as I know (that paper itself admits that it's holding a minority view). In addition to that, it has been debated whether [constitutionally speaking] ECA is truly a statute or just a joint rule--which would have implications whether the President should have a say [veto] in changes to it. To really test this, Congress would have to try to amend ECA's rules all by itself, bypassing the President, which against hasn't happened. What you asked about the states' executive having a say in [elector election] law changes is basically analogous to this debate. So, yeah, theoretically there are a lot constitutional crises possible in relation to electors, but unless someone actually plays those hardballs, at best you'll have some academics ponder them.)